<?php
//模板解析引擎
//实现了部分解析功能
class view{
	const TPL = 'view/';        //模板放置文件件
	static private $instance;
	
	public function __construct(){
		$this->getInstance();
	}
	
	public function getInstance(){
		if (self::$instance == null && !self::$instance instanceof self) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	
	public function parse($tplname){
		$content = file_get_contents($tplname);
		$content = str_ireplace();
		if(file_put_contents($tplname,$content)){
			fclose($fp);
		}
	}
	
	public function getTpl($tplname){
		file_exists(ROOT.TPL.$tplname.'.'.EXT)?include(ROOT.TPL.$tplname.'.'.EXT):include(ROOT.TPL.'404.'.EXT);
	}
}